﻿using IServices;
using Microsoft.AspNetCore.Mvc;
using System;
using YL.Core.Dto;
using YL.NetCore.Attributes;
using YL.NetCore.NetCoreApp;
using YL.Utils.Pub;
using YL.Utils.Table;

namespace KopSoftWms.Controllers
{
    public class InventoryRecordController : BaseController
    {
        private readonly IWms_inventoryServices _inventoryServices;

        public InventoryRecordController(
            IWms_inventoryServices inventoryServices
            )
        {
            _inventoryServices = inventoryServices;
        }

        [HttpGet]
        [CheckMenu]
        public IActionResult Index()
        {
            return View();
        }

        [HttpPost]
        [OperationLog(LogType.select)]
        public ContentResult List([FromForm]Bootstrap.BootstrapParams bootstrap)
        {
            var sd = _inventoryServices.GetInventoryPatchList(bootstrap);
            return Content(sd);
        }

        public IActionResult Detail(string id)
        {
            var mList = this._inventoryServices.GetInventoryByPatchId(Convert.ToInt64(id));
            ViewBag.mList = mList;
            return View();
        }
    }
}